import { Icon, Tooltip } from 'antd';
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import GovernTag from '../governPoint/tag';
export default class GovernLight extends React.Component {

    render() {
        const { record,showType,custyle } = this.props;
        let is_showlight = (showType != "feedback" && record.statusspan.split("_")[1] == '1') || showType === "feedback";
        return (
            is_showlight ? (
                <div className="g-governTag" style={custyle}>
                    {this.getTag()}
                </div>
            ) : (
                    <GovernTag ecId={`${this && this.props && this.props.ecId || ''}_GovernTag@nef1u9`} {...this.props} />
                )
        )
    }
    getTag = () => {
        const { record } = this.props;
        let isFinishTask = this.props.isFinishTask; //任务完成标志
        let isDiscard = this.props.isDiscard;//任务废弃标志
        let showType = this.props.showType;
        // return <icon className="icon-coms-Supervise" style={{"color":"red"}}/>
        // <Icon type="notification" style={{ "color": "red", "fontSize": "30px" }} />
        if (showType === "feedback") {
            if (record.feedstatusspan === "-1") {
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@quwpk9`} placement="topLeft" title={getLabel(22075, "未反馈")}>
                    <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@6uqucz`} type="notification" style={{ "color": "#f50", "fontSize": "18px" }} />
                </Tooltip>;
            } else if (record.feedstatusspan === "-2") {
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@xj6yor`} placement="topLeft" title={getLabel(501354, "已反馈")}>
                    <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@gvag4h`} type="notification" style={{ "color": "#2db7f5", "fontSize": "18px" }} />
                </Tooltip>;
            } else if (record.feedstatusspan === "-3") {
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@02j2lb`} placement="topLeft" title={getLabel(129630, "已办结")}>
                    <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@i4e6fd`} type="notification" style={{ "color": "#87d068", "fontSize": "18px" }} />
                </Tooltip>;
            }
        } else {
            let statusspan = record.statusspan.split("_")[0];
            if (statusspan === "0" || record.value === "0" && isFinishTask == false && isDiscard == false) {//未开始 0
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@v7crri`} placement="topLeft" title={getLabel(383418, "未开始")}>
                    {/* <Icon type="notification" style={{ "color": "#40566d", "fontSize": "30px" }} /> */}
                    <img src="/images/status/yel.png" />
                </Tooltip>;
            } else if (statusspan === "1" || record.value === "1" && isFinishTask == false && isDiscard == false) {//进行中 1
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@cytndb`} placement="topLeft" title={getLabel(501498, "进行中")}>
                    {/* <Icon type="notification" style={{ "color": "#2db7f5", "fontSize": "30px" }} /> */}
                    <img src="/images/status/blu.png" />
                </Tooltip>;
            } else if (statusspan === "2" || record.value === "2" && isFinishTask == false && isDiscard == false) {//已超期 2
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@rfvoye`} placement="topLeft" title={getLabel(21984, "已超期")}>
                    {/* <Icon type="notification" style={{ "color": "#f50", "fontSize": "30px" }} /> */}
                    <img src="/images/status/red.png" />
                </Tooltip>;
            } else if (statusspan === "3" || record.value === "3" || isFinishTask == true && isDiscard == false) {//已完成 3
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@c2lvaa`} placement="topLeft" title={getLabel(23774, "已完成")}>
                    {/* <Icon type="notification" style={{ "color": "#87d068", "fontSize": "30px" }} /> */}
                    <img src="/images/status/gre.png" />
                </Tooltip>;
            } else if (statusspan === "4" || record.value === "4" && isFinishTask == false && isDiscard == false) {//已废弃 4
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@8vtbtg`} placement="topLeft" title={getLabel('126185,81999', "已废弃")}>
                    {/* <Icon type="notification" style={{ "color": "#c7bfbc", "fontSize": "30px" }} /> */}
                    <img src="/images/status/gra.png" />
                </Tooltip>;
            }else if (statusspan === "5" || record.value === "5" && isFinishTask == false && isDiscard == false) {//已删除 4
                return <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@ba8mu0`} placement="topLeft" title={getLabel('126185,91', "已删除")}>
                    {/* <Icon type="notification" style={{ "color": "#c7bfbc", "fontSize": "30px" }} /> */}
                    <img src="/images/status/gra.png" />
                </Tooltip>;
            }
        }
    }
}
